GXOpenConnectionRetry
QuickDraw GX sends theGXOpenConnectionRetry
message if opening the connection fails. You can override theGXOpenConnectionRetry
message to try again to open the connection for a device. Your override of theGXOpenConnectionRetry
message must match the following formal declaration:
OSErr MyOpenConnectionRetry (ResType commType, void *commData, Boolean *pRetry, OSErr saveErr);
commType
- The resource type of the communications (
'comm'
) resource to use. The possible values are shown in Table 4-9.commData
- A pointer to the communications resource that is stored with the desktop printer.
pRetry
- On return, the Boolean value is
true
if QuickDraw GX needs to send theGXOpenConnection
message again andfalse
if not.saveErr
- The error code generated when the
GXOpenConnection
message failed.- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
QuickDraw GX sends theGXOpenConnectionRetry
message when a message handler calls theGXOpenConnection
and it returns an error. You can override this message when you are implementing a communications protocol for a printer that can be shared by multiple users and accepts only one connection at a time. Your override can interpret the error that is specified in thesaveErr
parameter as an indication that the printer is in use by another user and that the connection attempt needs to be tried again.The type of the communications resource, which you specify in the
commType
parameter, is one of the values shown in Table 4-9.The default implementation of the
OpenRetryConnection
message sets the value of thepRetry
return parameter tofalse
for most devices. The exception is for PAP devices that are using the PostScript imaging system. In this case, the default implementation sets thepRetry
parameter value totrue
if it determines that the printer is busy with another user's print job.If your device automatically handles retrying connections, override this message and set the
pRetry
parameter totrue
.SPECIAL CONSIDERATIONS
You never send theGXOpenConnectionRetry
message yourself.If you are implementing a nonsupported type of communications connection, you need to perform a total override of the
GXOpenConnectionRetry
message. Otherwise, you need to first forward the message and then perform your tasks.RESULT CODES
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. SEE ALSO
TheGXOpenConnection
message is described in the previous section.The communications (
'comm'
) resource is described in the section "The Communications ('comm') Resource" beginning on page 6-36 in the chapter "Printing Resources."
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help